<template>
  <div class="mt20">
    <el-card>
      <div slot="header" class="header">
        <i
          class="el-icon-back"
          @click="
            $router.push({
              path: '/order',
            })
          "
        ></i>
        订单详情
      </div>
      <!-- <el-divider></el-divider> -->
      <div>
        <!-- {{ detail }} -->
        <div>订单号：{{ detail.id }}</div>
        <div>下单时间：{{ detail.orderTime | formatYMDhms }}</div>
        <div>手机号：{{ detail.phone }}</div>
        <div>收货人：{{ detail.orderNo }}</div>
        <div>配速地址：{{ detail.deliverAddress }}</div>
        <div>送达时间：{{ detail.deliveryTime | formatYMDhms }}</div>
        <div>用户备注：{{ detail.remarks }}</div>
        <div>订单金额：{{ detail.orderAmount }}</div>
        <div>订单状态：{{ detail.orderState }}</div>
      </div>
    </el-card>
  </div>
</template>

<script>
import {getOrderDetailReq} from '@/api/order'

export default {
  data() {
    return {
      id: '',
      //数据占位
      detail: {},
    }
  },
  methods: {
    async getData() {
      let res = await getOrderDetailReq({
        id: this.id,
      })
      //数据赋值
      this.detail = res.data.data
    },
  },
  created() {
    //获取query传参
    this.id = this.$route.query.id

    this.getData()
  },
}
</script>

<style lang="scss" scoped></style>
